<?php

if( !defined( 'XOOPS_CUBE_LEGACY' ) ) {

if (is_object($xoopsTpl) && ($mydownloads_right_wide_theme === true)) {
$xoopsTpl->assign('xoops_showrblock', 0);
}
elseif (is_object($xoopsTpl)&& ($mydownloads_left_wide_theme === true)) {
$xoopsTpl->assign('xoops_showlblock', 0);
}
elseif (is_object($xoopsTpl)&& ($mydownloads_both_wide_theme === true)) {
$xoopsTpl->assign('xoops_showrblock', 0);
$xoopsTpl->assign('xoops_showlblock', 0);
}

}
else {

//in case of xoopscube
if (is_object($GLOBALS['xoopsTpl']) && ($mydownloads_right_wide_theme === true)) {
$GLOBALS['show_rblock'] = 0;
}
elseif (is_object($GLOBALS['xoopsTpl'])&& ($mydownloads_left_wide_theme === true)) {
$GLOBALS['show_lblock'] = 0;
}
elseif (is_object($GLOBALS['xoopsTpl'])&& ($mydownloads_both_wide_theme === true)) {
$GLOBALS['show_rblock'] = 0;
$GLOBALS['show_lblock'] = 0;
}

}

//wanikoo
$xoopsTpl->assign('mydownloadsshowextrafunc', $mydownloads_show_extrafunc);
$xoopsTpl->assign('mydownloadsshowextrafuncbig', $mydownloads_show_extrafunc_big);
$xoopsTpl->assign('mydownloadsshowsearch', $mydownloads_show_search);
$xoopsTpl->assign('mydownloadsshowlogo', $mydownloads_show_logo);
$xoopsTpl->assign('mydownloadslogoimage', $logoimage);

$xoopsTpl->assign('mydownloadsadcodes', $mydownloads_adcodes);
//wanikoo
$can_print = 0;
$can_pdf = 0;
$can_qrcode = 0;
//print func
if ( $mydownloads_can_print == 0 ) {
	$can_print = 0;
}
else if ( $mydownloads_can_print == 1) {
	$can_print = 1;
}
else if ( $mydownloads_can_print == 2) {
	if ( $xoopsUser ) {
	$can_print =1;
	}
	else {
	$can_print =0;
	}
}
else {
	$can_print = 0;
}

if ( empty($can_print) ) {
$xoopsTpl->assign('mydownloadsextrafuncprint', false);
}
else {
$xoopsTpl->assign('mydownloadsextrafuncprint', true);
}
//pdf func
if ( $mydownloads_can_pdf == 0 ) {
	$can_pdf = 0;
}
else if ( $mydownloads_can_pdf == 1) {
	$can_pdf = 1;
}
else if ( $mydownloads_can_pdf == 2) {
	if ( $xoopsUser ) {
	$can_pdf =1;
	}
	else {
	$can_pdf =0;
	}
}
else {
	$can_pdf = 0;
}

if ( empty($can_pdf) ) {
$xoopsTpl->assign('mydownloadsextrafuncpdf', false);
}
else {
$xoopsTpl->assign('mydownloadsextrafuncpdf', true);
}
//qrcode func
if ( $mydownloads_can_qrcode == 0 ) {
	$can_qrcode = 0;
}
else if ( $mydownloads_can_qrcode == 1) {
	$can_qrcode = 1;
}
else if ( $mydownloads_can_qrcode == 2) {
	if ( $xoopsUser ) {
	$can_qrcode =1;
	}
	else {
	$can_qrcode =0;
	}
}
else {
	$can_qrcode = 0;
}

if ( empty($can_qrcode) ) {
$xoopsTpl->assign('mydownloadsextrafuncqrcode', false);
}
else {
$xoopsTpl->assign('mydownloadsextrafuncqrcode', true);
}
//
$xoopsTpl->assign('lang_fullview', "detail");
$xoopsTpl->assign('lang_print', "print it");
$xoopsTpl->assign('lang_pdf', "make it pdf");
$xoopsTpl->assign('lang_qrcode', "make it qrcode");
//ver2.5
$xoopsTpl->assign('mydownloads_weburl', XOOPSMYDOWNLOADURL);
if (file_exists(XOOPSMYDOWNLOADIMGPATH."/".$mydownloads_theme)) {
$xoopsTpl->assign('mydownloads_imgurl', XOOPSMYDOWNLOADIMGURL."/".$mydownloads_theme);
}
else {
$xoopsTpl->assign('mydownloads_imgurl', XOOPSMYDOWNLOADIMGURL);
}
$xoopsTpl->assign('mydirname', $mydirname);


include_once XOOPS_ROOT_PATH.'/footer.php';

?>